home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume24 / sysVr4386slip / part04 < prev    next >
Encoding:
Internet Message Format  |  1991-03-21  |  17.9 KB

  1. Subject:  v24i081:  SystemVr4/386 SLIP driver and utilities, Part04/04
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: 4e23e9ed 17183269 1fbff542 374cef7f
  5.  
  6. Submitted-by: sudji@indo.intel.com (Sudji Husodo)
  7. Posting-number: Volume 24, Issue 81
  8. Archive-name: sysVr4386slip/part04
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then feed it
  12. # into a shell via "sh file" or similar.  To overwrite existing files,
  13. # type "sh file -c".
  14. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  15. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  16. # Contents:  Makefile dialslip/Makefile dialslip/README.dialslip
  17. #   dialslip/dslipuser.c dialslip/slip.config dialslip/slip.hosts
  18. #   driver/ID/Node driver/ID/System driver/io/slip.mk
  19. #   driver/sys/slip.h man/man1/slhangupd.1 utils/Makefile
  20. #   utils/sldetach
  21. # Wrapped by rsalz@litchi.bbn.com on Fri Mar 22 11:57:14 1991
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. echo If this archive is complete, you will see the following message:
  24. echo '          "shar: End of archive 4 (of 4)."'
  25. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'Makefile'\"
  27. else
  28.   echo shar: Extracting \"'Makefile'\" \(239 characters\)
  29.   sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  30. X#
  31. X# Makefile file for SLIP
  32. X#
  33. X
  34. Xall:
  35. X    cd driver/io; make -f slip.mk all install
  36. X    cd utils;     make all install
  37. X    cd dialslip;  make all install
  38. X
  39. Xclean:
  40. X    cd driver/io; make -f slip.mk clean
  41. X    cd utils;     make clean
  42. X    cd dialslip;  make clean
  43. END_OF_FILE
  44.   if test 239 -ne `wc -c <'Makefile'`; then
  45.     echo shar: \"'Makefile'\" unpacked with wrong size!
  46.   fi
  47.   # end of 'Makefile'
  48. fi
  49. if test -f 'dialslip/Makefile' -a "${1}" != "-c" ; then 
  50.   echo shar: Will not clobber existing file \"'dialslip/Makefile'\"
  51. else
  52.   echo shar: Extracting \"'dialslip/Makefile'\" \(460 characters\)
  53.   sed "s/^X//" >'dialslip/Makefile' <<'END_OF_FILE'
  54. XCC =    cc
  55. XCFLAGS =    -O -DUSG -I/usr/ucbinclude
  56. XLDFLAGS =    
  57. XLIBS =    -L/usr/ucblib -lsocket -lnsl -lucb
  58. X
  59. Xall: dslipuser mkslipuser slip
  60. X
  61. Xdslipuser: dslipuser.o
  62. X    $(CC) $(LDFLAGS) -o dslipuser dslipuser.o $(LIBS)
  63. X
  64. Xmkslipuser: mkslipuser.o
  65. X    $(CC) $(LDFLAGS) -o mkslipuser mkslipuser.o $(LIBS)
  66. X
  67. Xslip: slip.o
  68. X    $(CC) $(LDFLAGS) -o slip slip.o $(LIBS)
  69. X
  70. Xclean:
  71. X    rm -f *.o mkslipuser dslipuser slip
  72. X
  73. Xinstall:
  74. X    cp dslipuser mkslipuser slip /usr/sbin
  75. X    chmod 4755 /usr/sbin/slip
  76. END_OF_FILE
  77.   if test 460 -ne `wc -c <'dialslip/Makefile'`; then
  78.     echo shar: \"'dialslip/Makefile'\" unpacked with wrong size!
  79.   fi
  80.   # end of 'dialslip/Makefile'
  81. fi
  82. if test -f 'dialslip/README.dialslip' -a "${1}" != "-c" ; then 
  83.   echo shar: Will not clobber existing file \"'dialslip/README.dialslip'\"
  84. else
  85.   echo shar: Extracting \"'dialslip/README.dialslip'\" \(653 characters\)
  86.   sed "s/^X//" >'dialslip/README.dialslip' <<'END_OF_FILE'
  87. X
  88. Xsrc/new/slip.h
  89. X    edit to customize path names and line discipline
  90. X
  91. Xsrc/new/slip.config
  92. Xsrc/new/slip.hosts
  93. X    move to location specified in slip.h
  94. X
  95. Xsrc/new/dslipuser.c
  96. X    cc -O -o dslipuser dslipuser.c
  97. X
  98. Xsrc/new/mkslipuser.c
  99. X    cc -O -o mkslipuser mkslipuser.c
  100. X
  101. Xsrc/new/slip.c
  102. X    cc -O -o slip slip.c
  103. X
  104. XModifications:
  105. X01/31/91    Alan Batie
  106. X  - Ported slip.c dslipuser.c mkslipuser.c for Unix System V/386
  107. X    Release V.4.
  108. X
  109. X02/08/91    Sudji Husodo
  110. X  - modified to log slip activities to /var/slip/slip.log if the file exists.
  111. X  - changed the call to "system" to fork and exec, so we don't have to setuid
  112. X    slattach and ifconfig to root.
  113. X        
  114. END_OF_FILE
  115.   if test 653 -ne `wc -c <'dialslip/README.dialslip'`; then
  116.     echo shar: \"'dialslip/README.dialslip'\" unpacked with wrong size!
  117.   fi
  118.   # end of 'dialslip/README.dialslip'
  119. fi
  120. if test -f 'dialslip/dslipuser.c' -a "${1}" != "-c" ; then 
  121.   echo shar: Will not clobber existing file \"'dialslip/dslipuser.c'\"
  122. else
  123.   echo shar: Extracting \"'dialslip/dslipuser.c'\" \(1444 characters\)
  124.   sed "s/^X//" >'dialslip/dslipuser.c' <<'END_OF_FILE'
  125. X/*
  126. X * dslipuser.c
  127. X *
  128. X * Displays information on all of the users currently attached to the network.
  129. X *
  130. X * Copyright 1987 by University of California, Davis
  131. X *
  132. X * Greg Whitehead 10-1-87
  133. X * Computing Services
  134. X * University of California, Davis
  135. X *
  136. X * Revised: Geoff Arnold
  137. X * Sun Microsystems Inc.
  138. X * 10-28-87
  139. X */
  140. X
  141. X#include <stdio.h>
  142. X#include <ctype.h>
  143. X#include <sys/types.h>
  144. X#include <sys/file.h>
  145. X#include <sys/socket.h>
  146. X#include <netinet/in.h>
  147. X#include <arpa/inet.h>
  148. X#include <net/if.h>
  149. X#include <netdb.h>
  150. X#include <pwd.h>
  151. X#include "slip.h"
  152. X
  153. X#ifdef USG
  154. X#  include <sys/fcntl.h>
  155. X#endif
  156. X
  157. Xmain(argc,argv)
  158. Xint argc;
  159. Xchar **argv;
  160. X{
  161. X    int ufd;
  162. X    struct sl_urec urec;
  163. X    int free;
  164. X    struct passwd *upass;
  165. X    struct hostent *hh;
  166. X    int n = 0;
  167. X    int f = 0;
  168. X
  169. X    /*
  170. X     * Open USER_FL.
  171. X     *
  172. X     */
  173. X    if ((ufd=open(USER_FL,O_RDONLY))<0) {
  174. X    perror(USER_FL);
  175. X    exit(1);
  176. X    }
  177. X
  178. X
  179. X    /*
  180. X     * Display USER_FL.
  181. X     *
  182. X     */
  183. X    while (read(ufd,&urec,sizeof(urec))==sizeof(urec)) {
  184. X    if (urec.sl_uid >=0) {
  185. X            n++;
  186. X        upass=getpwuid(urec.sl_uid);
  187. X            hh = gethostbyaddr(&urec.sl_haddr, 4, AF_INET);
  188. X            printf("User %s connected as %s (%s) via %s%d\n",
  189. X        upass->pw_name, hh->h_name, inet_ntoa(urec.sl_haddr),
  190. X                IF_NAME,urec.sl_unit);
  191. X    }
  192. X    else
  193. X        f++;
  194. X    }
  195. X
  196. X    if (n == 0)
  197. X        printf("No dialup SLIP users connected.\n");
  198. X
  199. X    printf("(%d free line%s)\n",f,(f==1)?"":"s");
  200. X    
  201. X    close(ufd);
  202. X}
  203. END_OF_FILE
  204.   if test 1444 -ne `wc -c <'dialslip/dslipuser.c'`; then
  205.     echo shar: \"'dialslip/dslipuser.c'\" unpacked with wrong size!
  206.   fi
  207.   # end of 'dialslip/dslipuser.c'
  208. fi
  209. if test -f 'dialslip/slip.config' -a "${1}" != "-c" ; then 
  210.   echo shar: Will not clobber existing file \"'dialslip/slip.config'\"
  211. else
  212.   echo shar: Extracting \"'dialslip/slip.config'\" \(103 characters\)
  213.   sed "s/^X//" >'dialslip/slip.config' <<'END_OF_FILE'
  214. X# slip.user configuration file
  215. X#
  216. X128.120.254.2
  217. X128.120.254.2
  218. X128.120.254.2
  219. X128.120.254.2
  220. X128.120.254.2
  221. END_OF_FILE
  222.   if test 103 -ne `wc -c <'dialslip/slip.config'`; then
  223.     echo shar: \"'dialslip/slip.config'\" unpacked with wrong size!
  224.   fi
  225.   # end of 'dialslip/slip.config'
  226. fi
  227. if test -f 'dialslip/slip.hosts' -a "${1}" != "-c" ; then 
  228.   echo shar: Will not clobber existing file \"'dialslip/slip.hosts'\"
  229. else
  230.   echo shar: Extracting \"'dialslip/slip.hosts'\" \(142 characters\)
  231.   sed "s/^X//" >'dialslip/slip.hosts' <<'END_OF_FILE'
  232. X# dialup slip host table - maps usercodes to host addresses
  233. X#
  234. X128.120.253.1 user1
  235. X128.120.253.2 user2
  236. X128.120.253.3 user3
  237. X128.120.253.4 user4
  238. END_OF_FILE
  239.   if test 142 -ne `wc -c <'dialslip/slip.hosts'`; then
  240.     echo shar: \"'dialslip/slip.hosts'\" unpacked with wrong size!
  241.   fi
  242.   # end of 'dialslip/slip.hosts'
  243. fi
  244. if test -f 'driver/ID/Node' -a "${1}" != "-c" ; then 
  245.   echo shar: Will not clobber existing file \"'driver/ID/Node'\"
  246. else
  247.   echo shar: Extracting \"'driver/ID/Node'\" \(18 characters\)
  248.   sed "s/^X//" >'driver/ID/Node' <<'END_OF_FILE'
  249. Xclone    slip    c    slip
  250. END_OF_FILE
  251.   if test 18 -ne `wc -c <'driver/ID/Node'`; then
  252.     echo shar: \"'driver/ID/Node'\" unpacked with wrong size!
  253.   fi
  254.   # end of 'driver/ID/Node'
  255. fi
  256. if test -f 'driver/ID/System' -a "${1}" != "-c" ; then 
  257.   echo shar: Will not clobber existing file \"'driver/ID/System'\"
  258. else
  259.   echo shar: Extracting \"'driver/ID/System'\" \(23 characters\)
  260.   sed "s/^X//" >'driver/ID/System' <<'END_OF_FILE'
  261. Xslip    Y    1    0    0    0    0    0    0    0
  262. END_OF_FILE
  263.   if test 23 -ne `wc -c <'driver/ID/System'`; then
  264.     echo shar: \"'driver/ID/System'\" unpacked with wrong size!
  265.   fi
  266.   # end of 'driver/ID/System'
  267. fi
  268. if test -f 'driver/io/slip.mk' -a "${1}" != "-c" ; then 
  269.   echo shar: Will not clobber existing file \"'driver/io/slip.mk'\"
  270. else
  271.   echo shar: Extracting \"'driver/io/slip.mk'\" \(1464 characters\)
  272.   sed "s/^X//" >'driver/io/slip.mk' <<'END_OF_FILE'
  273. X#
  274. X#              Copyright 1991, Intel Corporation
  275. X#                    All rights reserved.
  276. X# Permission to use, copy, modify, and distribute this software and
  277. X# its documentation for any purpose and without fee is hereby granted,
  278. X# provided that the above copyright notice appear in all copies and
  279. X# that both the copyright notice appear in all copies and that both
  280. X# the copyright notice and this permission notice appear in
  281. X# supporting documentation, and that the name of Intel Corporation
  282. X# not be used in advertising or publicity pertaining to distribution
  283. X# of the software without specific, written prior premission.
  284. X# 
  285. X# COMPANY AND/OR INTEL DISCLAIM ALL WARRANTIES WITH REGARD TO
  286. X# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  287. X# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO
  288. X# EVENT SHALL COMPANY NOR INTEL BE LIABLE FOR ANY SPECIAL,
  289. X# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  290. X# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  291. X# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  292. X# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  293. X# OF THIS SOFTWARE.
  294. X#
  295. X
  296. X#
  297. X# Makefile for slip streams driver
  298. X#
  299. X
  300. XINC = ..
  301. XCFLAGS = -O -D_KERNEL $(MORECPP) -I$(INC)
  302. XOBJS = slip.o
  303. X
  304. Xall: Driver.o
  305. X
  306. XDriver.o: $(OBJS)
  307. X    $(LD) -r -o $@ $(OBJS)
  308. X
  309. Xclean:
  310. X    rm -rf *.o ../ID/Driver.o
  311. X
  312. Xinstall:
  313. X    cd ../ID; cp ../io/Driver.o .
  314. X    cp ../sys/slip.h /usr/include/sys
  315. X    cd ../ID; idinstall -d slip; idinstall -a -k -mnspo slip
  316. END_OF_FILE
  317.   if test 1464 -ne `wc -c <'driver/io/slip.mk'`; then
  318.     echo shar: \"'driver/io/slip.mk'\" unpacked with wrong size!
  319.   fi
  320.   # end of 'driver/io/slip.mk'
  321. fi
  322. if test -f 'driver/sys/slip.h' -a "${1}" != "-c" ; then 
  323.   echo shar: Will not clobber existing file \"'driver/sys/slip.h'\"
  324. else
  325.   echo shar: Extracting \"'driver/sys/slip.h'\" \(2449 characters\)
  326.   sed "s/^X//" >'driver/sys/slip.h' <<'END_OF_FILE'
  327. X/*
  328. X *            Copyright 1991, Intel Corporation
  329. X *                  All rights reserved.
  330. X *
  331. X * Permission to use, copy, modify, and distribute this software and
  332. X * its documentation for any purpose and without fee is hereby granted,
  333. X * provided that the above copyright notice appear in all copies and
  334. X * that both the copyright notice appear in all copies and that both
  335. X * the copyright notice and this permission notice appear in
  336. X * supporting documentation, and that the name of Intel Corporation
  337. X * not be used in advertising or publicity pertaining to distribution
  338. X * of the software without specific, written prior premission.
  339. X * 
  340. X * COMPANY AND/OR INTEL DISCLAIM ALL WARRANTIES WITH REGARD TO
  341. X * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  342. X * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO
  343. X * EVENT SHALL COMPANY NOR INTEL BE LIABLE FOR ANY SPECIAL,
  344. X * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  345. X * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  346. X * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  347. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  348. X * OF THIS SOFTWARE.
  349. X */
  350. X
  351. X/*
  352. X * Header file for Intel Unix System V/386 Release 4.0 SLIP streams driver.
  353. X */    
  354. X
  355. Xtypedef struct {
  356. X    u_int    state;                /* state of the entry */
  357. X    u_int    sap;                /* service access point */
  358. X    queue_t    *qtop;                /* upper streams read queue */
  359. X    queue_t    *qbot;                /* lower streams write queue */
  360. X    u_int    qt_blocked;            /* blocked upper write service flag */
  361. X    pid_t    pid;                /* process id of application */
  362. X    u_char    *buf;                /* incoming packet buffer */
  363. X    u_int    inlen;                /* length of captured data */
  364. X    short    escape;                /* flag if an ESC is detected */
  365. X    short    overrun;            /* flag if incoming data exceeds SLIPMTU */
  366. X    short    flags;                /* flag to be set (read/write) by user */
  367. X    u_char    uname[IFNAMSIZ];    /* slip interface unit name */
  368. X    struct    ifstats    stats;        /* slip interface statistics */
  369. X} slip_t;
  370. X
  371. X/* The following defines is taken from RFC 1005 */
  372. X
  373. X#define SLIPMTU    1006            /* maximum slip packet size */
  374. X
  375. X#define    END        0300            /* frame end character */
  376. X#define    ESC        0333            /* frame escape character */
  377. X#define    ESC_END    0334            /* transposed frame end */
  378. X#define    ESC_ESC    0335            /* transposed froam esc */
  379. X
  380. X/* the following are definitions for slip special I_STR ioctl */
  381. X
  382. X#define REG_SLHUP    1            /* i_str ioctl to register slip hangup daemon */
  383. X#define UNREG_SLHUP    2            /* i_str ioctl to unregister sl hangup daemon */
  384. END_OF_FILE
  385.   if test 2449 -ne `wc -c <'driver/sys/slip.h'`; then
  386.     echo shar: \"'driver/sys/slip.h'\" unpacked with wrong size!
  387.   fi
  388.   # end of 'driver/sys/slip.h'
  389. fi
  390. if test -f 'man/man1/slhangupd.1' -a "${1}" != "-c" ; then 
  391.   echo shar: Will not clobber existing file \"'man/man1/slhangupd.1'\"
  392. else
  393.   echo shar: Extracting \"'man/man1/slhangupd.1'\" \(2194 characters\)
  394.   sed "s/^X//" >'man/man1/slhangupd.1' <<'END_OF_FILE'
  395. X.\"
  396. X.\"             Copyright 1991, Intel Corporation
  397. X.\"                   All rights reserved.
  398. X.\"
  399. X.\" Permission to use, copy, modify, and distribute this software and
  400. X.\" its documentation for any purpose and without fee is hereby granted,
  401. X.\" provided that the above copyright notice appear in all copies and
  402. X.\" that both the copyright notice appear in all copies and that both
  403. X.\" the copyright notice and this permission notice appear in
  404. X.\" supporting documentation, and that the name of Intel Corporation
  405. X.\" not be used in advertising or publicity pertaining to distribution
  406. X.\" of the software without specific, written prior permission.
  407. X.\" 
  408. X.\" COMPANY AND/OR INTEL DISCLAIM ALL WARRANTIES WITH REGARD TO
  409. X.\" THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  410. X.\" MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO
  411. X.\" EVENT SHALL COMPANY NOR INTEL BE LIABLE FOR ANY SPECIAL,
  412. X.\" INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  413. X.\" RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  414. X.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION,
  415. X.\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  416. X.\" OF THIS SOFTWARE.
  417. X.\" 
  418. X.TH slhangupd 1M "TCP/IP"
  419. X.SH NAME
  420. Xslhangupd \- slip hangup daemon
  421. X.SH SYNOPSIS
  422. X.nf
  423. X.ft B
  424. X/usr/sbin/slhangupd
  425. X.ft R
  426. X.fi
  427. X.SH DESCRIPTION
  428. X.PP
  429. XDue to the interworkings of the TCP/IP protocol stack, hangup signals
  430. Xfrom the tty may not reach \fIslattach\fP to notify it that the SLIP
  431. Xconnection has been lost.
  432. X\fBSlhangupd\fP is a daemon that receives messages from the \fISLIP\fP driver
  433. X(in the form of process IDs) and sends a SIGHUP signal to the specified
  434. Xprocess ID on behave of the tty.
  435. X.PP
  436. XWhen the \fISLIP\fP driver is first opened, it stores the process ID of
  437. Xthe program that did the open.
  438. XNormally, this will be \fIslattach\fP.
  439. XWhenever \fISLIP\fP receives a M_HANGUP message from the STREAMS driver under
  440. Xit (usually a tty driver), it sends the process ID of the program that did the
  441. Xinitial open to \fBslhangupd\fP.
  442. XWhen \fBslhangupd\fP receives the message, it sends a SIGHUP to the process ID
  443. Xspecified in the message.
  444. X.SH SEE ALSO
  445. Xslattach(1M), asy(7), slip(7)
  446. X.SH FILES
  447. X/dev/slip
  448. X.SH AUTHOR
  449. XSudji Husodo
  450. END_OF_FILE
  451.   if test 2194 -ne `wc -c <'man/man1/slhangupd.1'`; then
  452.     echo shar: \"'man/man1/slhangupd.1'\" unpacked with wrong size!
  453.   fi
  454.   # end of 'man/man1/slhangupd.1'
  455. fi
  456. if test -f 'utils/Makefile' -a "${1}" != "-c" ; then 
  457.   echo shar: Will not clobber existing file \"'utils/Makefile'\"
  458. else
  459.   echo shar: Extracting \"'utils/Makefile'\" \(1440 characters\)
  460.   sed "s/^X//" >'utils/Makefile' <<'END_OF_FILE'
  461. X#
  462. X#              Copyright 1991, Intel Corporation
  463. X#                    All rights reserved.
  464. X# Permission to use, copy, modify, and distribute this software and
  465. X# its documentation for any purpose and without fee is hereby granted,
  466. X# provided that the above copyright notice appear in all copies and
  467. X# that both the copyright notice appear in all copies and that both
  468. X# the copyright notice and this permission notice appear in
  469. X# supporting documentation, and that the name of Intel Corporation
  470. X# not be used in advertising or publicity pertaining to distribution
  471. X# of the software without specific, written prior premission.
  472. X# 
  473. X# COMPANY AND/OR INTEL DISCLAIM ALL WARRANTIES WITH REGARD TO
  474. X# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  475. X# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO
  476. X# EVENT SHALL COMPANY NOR INTEL BE LIABLE FOR ANY SPECIAL,
  477. X# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  478. X# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  479. X# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  480. X# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  481. X# OF THIS SOFTWARE.
  482. X
  483. X#
  484. X# Makefile for slip utilities
  485. X#
  486. X
  487. XCFLAGS=-O
  488. XLIBS=-lnsl
  489. XOBJS=slattach.o
  490. XPROGS=slattach slhangupd sldetach
  491. XTARGET=/usr/sbin
  492. X
  493. X.c.o:
  494. X    $(CC) $(CFLAGS) -c $*.c
  495. X
  496. Xall: slattach slhangupd
  497. X
  498. Xslattach: $(OBJS)
  499. X    $(CC) $(CFLAGS) $(OBJS) -o $@ $(LIBS)
  500. X
  501. Xclean:
  502. X    rm -rf *.o slattach slhangupd
  503. X
  504. Xinstall:
  505. X    cp $(PROGS) $(TARGET)
  506. END_OF_FILE
  507.   if test 1440 -ne `wc -c <'utils/Makefile'`; then
  508.     echo shar: \"'utils/Makefile'\" unpacked with wrong size!
  509.   fi
  510.   # end of 'utils/Makefile'
  511. fi
  512. if test -f 'utils/sldetach' -a "${1}" != "-c" ; then 
  513.   echo shar: Will not clobber existing file \"'utils/sldetach'\"
  514. else
  515.   echo shar: Extracting \"'utils/sldetach'\" \(322 characters\)
  516.   sed "s/^X//" >'utils/sldetach' <<'END_OF_FILE'
  517. X:
  518. X#
  519. X# sldetach removes the serial line that is being used for slip connection.
  520. X#
  521. X
  522. Xif [ $# != 1 ]; then
  523. X    echo "Usage: sldetach interface"
  524. X    exit 1
  525. Xfi
  526. X
  527. Xps=`ps -ef | grep -v grep | grep slattach | grep $1`
  528. X
  529. Xif [ "$ps" != "" ]; then
  530. X    kill -1 `echo $ps | nawk '{print $2}'`
  531. Xelse
  532. X    echo "sldetach: interface unit $1 not found"
  533. Xfi
  534. END_OF_FILE
  535.   if test 322 -ne `wc -c <'utils/sldetach'`; then
  536.     echo shar: \"'utils/sldetach'\" unpacked with wrong size!
  537.   fi
  538.   chmod +x 'utils/sldetach'
  539.   # end of 'utils/sldetach'
  540. fi
  541. echo shar: End of archive 4 \(of 4\).
  542. cp /dev/null ark4isdone
  543. MISSING=""
  544. for I in 1 2 3 4 ; do
  545.     if test ! -f ark${I}isdone ; then
  546.     MISSING="${MISSING} ${I}"
  547.     fi
  548. done
  549. if test "${MISSING}" = "" ; then
  550.     echo You have unpacked all 4 archives.
  551.     rm -f ark[1-9]isdone
  552. else
  553.     echo You still must unpack the following archives:
  554.     echo "        " ${MISSING}
  555. fi
  556. exit 0
  557. exit 0 # Just in case...
  558.